package com.example.medicine.Mapper;

import com.example.medicine.Bean.SystemRole;
import com.example.medicine.Bean.Team;
import com.example.medicine.controller.SystemRoleController;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SystemRoleMapper {
    @Select("select * from [SystemRole] where ID=#{ID}")
    SystemRole getById(String ID);
    /**
     * 从SystemRole中查询全部
     * @return
     */
    @Select("select * from [SystemRole]")
    List<SystemRole> getAll();


    @Select("select ID from [SystemRole] where RoleName=#{RoleName}")
    String getIdByName(String RoleName);

    /**
     * 像SystemRole插入角色名称，描述和备注
     * @param systemrole
     */
    @Insert("insert into [SystemRole](ID,RoleName, Description, Remark,SetTime) values(newid(), #{RoleName}, #{Description}, #{Remark},getdate())")
    void insert(SystemRole systemrole);

    /**
     * 根据ID更新SystemRole表
     * @param
     */
    @Update("update [SystemRole] set RoleName=#{RoleName}, Description=#{Description}, Remark=#{Remark} where ID=#{ID}")
    void update(SystemRole SystemRole);
    /**
     * 根据id删除Team表中记录
     * @param
     */
    @Delete("delete from [SystemRole] where ID=#{ID}")
    void deleteById(String ID);
}
